com.supermap.data
Class RecycleLicenseManager
- java.lang.Object
-
- com.supermap.data.RecycleLicenseManager
-
public class RecycleLicenseManager extends java.lang.Object
The license recycle manager class. It is used to activate, query, bind, return and upgrade license. All results generated by license management are returned by using callbacks. Each callback will be executed in the thread where the object of the class is created. Such as, when initializing an object in Activity, the callback will be performed in the UI thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
RecycleLicenseManager.RecycleLicenseCallback
The recycle license activation callback interface
-
Constructor Summary
Constructors Constructor and Description RecycleLicenseManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
activateDevice(java.lang.String userSerialNumber, java.util.ArrayList<Module> modules)
Activate the device online.void
bindPhoneNumber(java.lang.String phoneNumber)
Bind the phone number.void
clearLocalLicense()
Clear local license filestatic RecycleLicenseManager
getInstance(android.content.Context context)
Gets the instance of the license manager class.LicenseStatus
getLicenseStatus()
Gets the license status.void
query(java.lang.String userSerialNumber)
Query available modules, and return the result by callback.void
queryLicenseCount(java.lang.String userSerialNumber)
Search the number of licensesvoid
recycleLicense(java.lang.String phoneNumber)
Return license.boolean
setActivateCallback(RecycleLicenseManager.RecycleLicenseCallback callback)
Set the online verification callback.void
upgrade(java.lang.String userSerialIDFrom, java.lang.String userSerialIDTo)
Upgrade the license.
-
-
-
Method Detail
-
getLicenseStatus
public LicenseStatus getLicenseStatus()
Gets the license status.- Returns:
- Returns the license status of the current license.
-
setActivateCallback
public boolean setActivateCallback(RecycleLicenseManager.RecycleLicenseCallback callback)
Set the online verification callback.- Parameters:
callback
- The recycle license activation callback.- Returns:
- Whether it is successful set
-
getInstance
public static RecycleLicenseManager getInstance(android.content.Context context)
Gets the instance of the license manager class.- Parameters:
context
- Application context.- Returns:
- The instance of license manager class.
-
query
public void query(java.lang.String userSerialNumber)
Query available modules, and return the result by callback.- Parameters:
userSerialNumber
- the user serial number.
-
activateDevice
public boolean activateDevice(java.lang.String userSerialNumber, java.util.ArrayList<Module> modules)
Activate the device online.- Parameters:
userSerialNumber
- the user serial number.modules
- The list of modules required.- Returns:
- Whether to start activation. The activated result returns by callback.
-
bindPhoneNumber
public void bindPhoneNumber(java.lang.String phoneNumber)
Bind the phone number. Unique. If this phone number has been bound, it will be failed to bind. If the phone number is not activated, it will also be failed.- Parameters:
phoneNumber
- the user phone number
-
recycleLicense
public void recycleLicense(java.lang.String phoneNumber)
Return license. Activate the license before return. If it binds with phone number, you can only return via phone number. If not, you can pass parameter null- Parameters:
phoneNumber
- return via phone number
-
upgrade
public void upgrade(java.lang.String userSerialIDFrom, java.lang.String userSerialIDTo)
Upgrade the license. There are two ways for upgrading: 1. Version before 9D, you should upgrade license via this API instead of activation API. 2. 9D license can be directly used. It means that you change the serial number, and the license must be activated before use. By default, it returns origonal license and activate new license.- Parameters:
userSerialIDFrom
- the serial number for upgradeuserSerialIDTo
- the serial number to upgrade
-
queryLicenseCount
public void queryLicenseCount(java.lang.String userSerialNumber)
Search the number of licenses- Parameters:
userSerialNumber
- the serial number.
-
clearLocalLicense
public void clearLocalLicense()
Clear local license file
-
-